import MySQLdb

def getconn():
    db = MySQLdb.connect("localhost", "root", "12345678", "party")
    cursor = db.cursor()
    return cursor

if __name__ == '__main__':
    conn = getconn()
    cursor = conn.execute("select uptime from bullet")
    for item in conn.fetchall():
        print(item)
    conn.close()